Skip to content

FEAT: Add 'templates' command to list bundled templates#13

Merged
renezander030 merged 5 commits into
renezander030:masterfrom
CaptainLevi25:feat/show-available-templates
May 31, 2026
Merged

FEAT: Add 'templates' command to list bundled templates#13
renezander030 merged 5 commits into
renezander030:masterfrom
CaptainLevi25:feat/show-available-templates

Conversation

@CaptainLevi25
Copy link
Copy Markdown
Contributor

Summary

Adds a new templates command to make bundled templates discoverable from the CLI.

Previously, users could apply bundled templates via apply-template, but there was no way to list the available templates without inspecting the repository contents. This change introduces a dedicated command that enumerates bundled templates from the shipped templates/ directory.

Usage

capcut templates or capcut templates -H

Resolves

Resolves #11

Changes

  • Added capcut templates command.
  • Resolves bundled templates from the package templates/ directory.
  • Supports human-readable output with -H / --human.
  • Added descriptions for bundled templates:
- caption-pop
- lower-third
- hook-question
- gold-title
- end-card
- subscribe-cta
  • Added automated tests covering

Screenshots

capcut templates or capcut templates -H

Screenshot 2026-05-30 215106

npm run test

Screenshot 2026-05-30 215134

capcut --help

Screenshot 2026-05-30 215214

Please review the PR at your convenience and suggest improvements required. I will try my best to resolve it.

Thanks a lot!

@CaptainLevi25
Copy link
Copy Markdown
Contributor Author

CaptainLevi25 commented May 31, 2026

Hi @renezander030 . The issue with linting was when I ran the format almost all files were modified even though I touched only index. Js and test/showTemplates.js

In git status after running the lint more than 10 files modified message were showing.

That's why I gave the PR without linting.

Any solution for this?

Thanks.

@renezander030
Copy link
Copy Markdown
Owner

Thanks @CaptainLevi25 — and good instinct holding the lint reformat back. You diagnosed it exactly right: npm run lint rewrites ~10 files you never touched because of pre-existing Biome debt in src/decorators.ts / src/draft.ts (noAssignInExpressions, noGlobalIsFinite, useTemplate, useOptionalChain). Folding those unrelated reformats into a feature PR would be the wrong call, so you did the right thing.

That one's on me — I'll clear the lint debt on master and pin Biome to an exact version in a separate commit. Once that lands, just merge/rebase master into your branch and CI will go green. Nothing for you to fix on the lint side.

Your actual change is clean: tests pass on Node 18/20/22 and src/index.ts has zero lint findings. Two small things on the PR itself:

  1. README link label — the new bullet links [`template`] (singular), but the command is templates; please fix the visible label.
  2. (optional) close the loopapply-template reads a literal file path (readFileSync(templatePath)), so it won't resolve a bare slug like gold-title. Listing the slug is exactly what Add 'templates' command to list bundled templates (discoverability for apply-template) #11 asked for, so this is fine to merge as-is. If you want a nice follow-up, have templates also emit the resolvable path (e.g. a path field in the JSON + the path in the -H table) so users can paste straight into apply-template.

Fix the README label, and once I've cleared master + you rebase, I'll merge. Thanks for the clean work!

@renezander030
Copy link
Copy Markdown
Owner

Correction to my last comment, @CaptainLevi25 — I dug into the CI log properly and I had it wrong. The pre-existing decorators.ts/draft.ts findings are warnings (intentionally non-blocking), so they're not what fails your build.

The one thing actually failing CI is a single error in your src/index.ts: the new imports aren't in Biome's required order (assist/source/organizeImports). It's a one-line fix — just alphabetize the node:fs named imports:

-import { existsSync, readFileSync, writeFileSync, readdirSync } from "node:fs";
+import { existsSync, readdirSync, readFileSync, writeFileSync } from "node:fs";

Or let Biome do exactly that one fix without touching anything else:

npx biome check --write --only=assist/source/organizeImports src/index.ts

That's the whole blocker — after it, biome check reports no errors and CI goes green. (Avoid biome check --write --unsafe / format-on-save for now: that's what rewrites ~9 unrelated files. I'm cleaning that debt up separately in #14 so it stops biting contributors — but you don't need to wait for it.)

So: that one import reorder + the README link-label fix from above, and you're good to merge. Sorry for the misdirection!

renezander030 and others added 2 commits May 31, 2026 06:43
@renezander030
Copy link
Copy Markdown
Owner

Rebased, fixed the import order + README label, and merged — thanks @CaptainLevi25! 🙌

# Conflicts:
#	src/index.ts
@CaptainLevi25
Copy link
Copy Markdown
Contributor Author

hi @renezander030 .
Thanks a lot for fixing the mistakes that i have commited😂🫡.

@renezander030 renezander030 merged commit 110cb69 into renezander030:master May 31, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add 'templates' command to list bundled templates (discoverability for apply-template)

2 participants